import JSEncrypt from 'jsencrypt'
import {getPublicKey} from '@/api/common.js'
export default async function(str) {
  // console.log(api)
  const res = await getPublicKey()
  const encrypt = new JSEncrypt()
  encrypt.setPublicKey(res.data)
  return encrypt.encrypt(str)
}
